//api文件夹下将接口以页面为模块划分依据进行划分,每个页面搞一个js文件
//每个js文件中按需到处当前页面所需要的接口,在需要的某个接口的时候,按需导入指定的接口
import request from '@/utils/request'
//获取用户频道
export const getChannelsApi = params => request({
    url: '/v1_0/user/channels',
    params:params
})

//获取频道对应数据
export const getArticleListApi = (params) => {
    return request({
        method:'get',
        url: '/v1_0/articles',
        params:params
    })
}

//获取所有频道数据
export const getAllChannerApi = () => {
    return request({
        method:'get',
        url: '/v1_0/channels',
    })
}

//添加用户频道
export const addUserChannelApi = (data) => {
    return request({
        url: '/v1_0/user/channels',
        method: 'PATCH',
        data:data
    })
}

//删除用户指定频道
export const deleteUserChannelApi = (id) => {
    return request({
        url:'/v1_0/user/channels/'+ id,
        method: 'delete',
    })
}